package cn.alpha.intell.rbtlib.broadcast;

/**
 * Created by zhangxiliang on 2016/9/23.
 */
public enum  AlphaMsgType {
    IM_SOCKET_OK("im_socket_ok"),
    IM_SOCKET_FAIL("im_socket_fail"),
    ROBOT_BIND_OK("robot.connect.success"),
    ROBOT_BIND_FAIL("robot.connect.fail"),
    ROBOT_UNBIND_OK("robot.config.err.to.unbind"),
    ROBOT_UNBIND_PMS_OK("robot.disconnect.success"),
    ROBOT_UNBIND_MOB_OK("robot.2factor.confirmed"),
    ROBOT_UPDATE("robot.config.updated"),
    ROBOT_APPLY_FRIEND("robot.friend.apply"),
    ROBOT_UPDATE_BABY_NAME("robot.id.changed"),
    ALPHA_IM_MSG("alpha.im.msg"),
    ALPHA_APP_MSG("alpha_app_msg"),
    HEARTBEAT_STOP("26"),
    HEARTBEAT_START("27"),
    ROBOT_SLEEP_TIME("38"),
    ROBOT_WAKE("39"),
    MONITOR_END("15"),
    MONITOR_LEFT("07"),
    MONITOR_RIGHT("08") ,
    MONITOR_UP("09"),
    MONITOR_DOWN("10"),
    MONITOR_OPEN_MUTE("13"),
    MONITOR_CLOSE_MUTE("14"),
    MOB_CHANGE("99"),
    MOB_SHAKE("100"),
    HANGUP_CALL("98"),
    SDCARD_SIZE("43"),
    STOP_CHAT_SERVICE("105"),
    BAD_NET(BroadcastConstant.ACTION_BAD_NET),
    PHOTO_LOAD_COMPELTE("photo_load_compelte"),
    SAVE_PHOTO("save_photo"),

    KILL_THIRD_APP("POLICY_THIRD_APP"),
    BACK_LAUNCHER(BroadcastConstant.ACTION_LUANCHER_RESUME);

    private String value;

    // 构造方法
    AlphaMsgType(String value) {
        this.value = value;
    }


    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return this.getValue();
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static AlphaMsgType fromString(String text) {
        if (text != null) {
            for (AlphaMsgType command : AlphaMsgType.values()) {
                if (text.equalsIgnoreCase(command.getValue())) {
                    return command;
                }
            }
        }
        return null;
    }
}
